package com.bcu.cn.onlineexamsystem.user.service;

import com.bcu.cn.onlineexamsystem.Repository.ScoreRepository;
import com.bcu.cn.onlineexamsystem.user.entity.Course;
import com.bcu.cn.onlineexamsystem.Repository.CourseRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminService {

    @Autowired
    private CourseRepository courseRepository;
    private ScoreRepository scoreRepository;

    // 管理员维护课程信息
    public void manageCourse(Course course) {
        courseRepository.save(course);
    }

    // 删除异常成绩记录
    public void deleteScore(Long id) {
        scoreRepository.deleteById(id);
    }
/// 添加方法
    public Object getAllCourses() {

        return courseRepository.findAll();
    }
}
